<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="./Public/Home/org/content.css"/>
	</head>
	<script src="./Public/jquery-1.8.2.min.js"></script>
	<script type="text/javascript">
		$(function(){
			$(".anpai").click(function(){
//				alert(1);
				var a=$('.shops').text();
				var b=$('.inventory').text();
				var id=<?php echo Q('get.sid')?>;				
				var sname="<?php echo $shopDetailedata['sname']?>";
								
				
				var listgroup="<?php echo $shopDetailedata['atlas']?>";

				var str='';
						$.each($('.bk'),function(){
							str+=$(this).attr('sid') + ',';
						})
				var spec=[];
				$.each($('.xuanze'),function(k,v){
					var gtname=$(this).find('span').text();
					var gtvalue=$(this).find('.bk').text();
					spec.push(gtname+':'+gtvalue);
				})

				$.ajax({
					type:'post',
					url:"<?php echo U('Cart/add')?>",
					data:{money:a,pid:b,id:id,spec:spec,name:sname,listgroup:listgroup,str:str},
					dataType:'json',
					success:function(db){
						if(db){
							alert('添加成功');
							parent.location.href="<?php echo U('Cart/index')?>";
						}
					}
				})
			})
//			num=1;
////			减一件商品
//			$(".jian").click(function(){
//				num--;
//				if(num<=1){
//					num=1;
//				}
//				$(".num").val(num);				
//			})
////			加一件商品
//			$(".jia").click(function(){				
//				num++;
//				$('.num').val(num);
//			})			
//			商品属性的选择异步
			$('.xuanze li').click(function(){				
				$(this).addClass('bk').siblings().removeClass('bk');
//				商品属性的个数
				var liLen=$('.xuanze').length;	
//				选中属性的个数
				var bkLen=$('.bk').length;
//				如果他们相等 就说明用户已经选好了所有的商品属性
					if(bkLen==liLen){
						var str='';
						$.each($('.bk'),function(){
							str+=$(this).attr('sid') + ',';
						})
						$.ajax({
							type:"post",
							url:"<?php echo U('Content/getattr')?>",
							data:{str:str},
							dataType:'json',
							success:function(phpData){
								$('.inventory').html(phpData.inventory);		
							}						
						})						
					}
			})
		})	
	</script>
	<body>
		<!--头部-->
		<div id="top">			
			<ul class="top_long">
				<a href="http://localhost/car_shop/index.php?m=Home&c=Index&a=index"><div class="qczj"><img src="./Public/Home/imgs/logo-auto-92438.png"/></div></a>			
				<a href="http://localhost/car_shop/index.php?m=Home&c=Dingdan&a=index"><li myOrder>我的订单</li></a>	
				<span class="shu">|</span>

								<a href="http://localhost/car_shop/index.php?m=Home&c=Member&a=out"><li class="login">退出 </li></a>
					
				<a href="http://localhost/car_shop/index.php?m=Home&c=Member&a=index"><li class="login">admin </li></a>


							</ul>
			
		</div>
		<!--大盒子-->
		<div id="box">
			<!--搜索开始-->
			<div id="search">
					<a href="http://localhost/car_shop/index.php?m=Home&c=Index&a=index"> <img class="tupian" src="./Public/Home/imgs/header-logo-mall-363de.png"/></a>
					<div id="search_in">
						<form action='http://localhost/car_shop/index.php?m=home&c=List&a=ss' method='post'>
							<input type="text" name="ss" id="" value="" placeholder="请输入关键字" />
							<input type='submit' class="sousuo" value='搜索'>
						</form>
					</div>				
					<div class="gouwu">
						<i class="gw_tp"></i>
						<i class="dayu">&gt;</i>
												<i class="shuzi">0</i>	
								
						<a target="_blank" href="http://localhost/car_shop/index.php?m=Home&c=Cart&a=index" >我的购物车</a>
					</div>		
			</div>
			<!--搜索结束-->
			<!--分类导航-->
			<div id="category">
				<ul>
					<a href=""><li class="first">全部分类</li></a>
					<a href="http://localhost/car_shop/index.php?m=Home&c=Index&a=index"><li class="second">首页</li></a>
										<a href="http://localhost/car_shop/index.php?m=Home&c=List&a=index&cid=4"><li class="three">SUV</li></a>
										<a href="http://localhost/car_shop/index.php?m=Home&c=List&a=index&cid=16"><li class="three">微型车</li></a>
										<a href="http://localhost/car_shop/index.php?m=Home&c=List&a=index&cid=17"><li class="three">小型车</li></a>
										<a href="http://localhost/car_shop/index.php?m=Home&c=List&a=index&cid=18"><li class="three">中型车</li></a>
										<a href="http://localhost/car_shop/index.php?m=Home&c=List&a=index&cid=19"><li class="three">大型车</li></a>
										<!--<a href=""><li class="three">级别</li></a>-->
					<!--<a href=""><li class="four">分期购车</li></a>
					<a href=""><li class="three">定制车</li></a>-->
				</ul>			
			</div>
			<div class="car_show">
				<div class="cartu">
					<img width="486" height="359" src="<?php echo $shopDetailedata['atlas']?>"/>
				</div>
				<div class="car_content">
					<div class="content-title">
						<h2 class="detail-info-title"><?php echo $shopDetailedata['sname']?></h2>
						<br />						
					</div>
				
					
					<div class="detail-form">
						<ul>
							<li><dt class="yikoujia">&nbsp;&nbsp;&nbsp;&nbsp;一口价：</dt>￥<span class="shops"><?php echo $shopDetailedata['shop']?></span>万</li>
						</ul>
					</div>
					<div class="kucun">
						<p id="p1">市场价： ￥<?php echo $shopDetailedata['market']?>万</p>
						<p id="p2" >&nbsp;库存：<span class="inventory"><?php echo $shopDetailedata['stock']?></span>辆</p>
					</div>
					<div class="ticheinfo">
						<?php foreach ($finalAttr as $v){?>
						<ul class="xuanze">
							
							<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $v['name']?>:</span>
								<?php foreach ($v['value'] as $value){?>
									<li class="sid" sid="<?php echo $value['sid']?>"><?php echo $value['shop_attributecol']?></li>
								<?php }?>							
						</ul>
						<?php }?>
						<div class="qianggou">
							<a class="qiang" href="<?php echo U('Tijiao/index')?>">立即抢购</a>
							<a class="anpai" href="javascript:;">加入购物车</a>
						</div>
						<div class="fuwu">
							<i class="dianhua"></i>
							<span>任何购车问题请拨打：13941148919</span>
						</div>
					</div>
				</div>
			</div>
			<!--购买说明-->
			<div class="gmsm">
				<!--购买说明左侧-->
				<div class="qtsp">
					<div class="other">看过车的人还看过</div>
					<?php foreach ($shopData as $v){?>
					<a href="<?php echo U('Content/index',array('sid'=>$v['sid']))?>"><li>
						<img src="<?php echo $v['listGraph']?>"/>
						<em>¥</em>
						<span id=""><?php echo $v['shop']?>万</span>
						<p><?php echo $v['sname']?></p>
						<div class="carbox-tip" title="新车上市，车商城独家任性抢先购，享受购置税减半政策，点击商品介绍头图，领取千元大礼，百分百中奖率。">
                    		新车上市，车商城独家任性抢先购，享受购置税减半政策。
                		</div>
                		<div class="carbox-number">
                    	已有
                    	<span id="onePriceSaleCount-137512" style="">2</span>条购买记录
               			 </div>
                		<span class="carbox-producttype">一口价</span>
					</li></a>
					<?php }?>					
				</div>
				<!--左侧结束-->
				<!--购买说明右侧-->
				<div class="xiangqing">
					<div class="goumai_tap">
						<ul>
							<a href="javacript:;"><li>购买说明</li></a>
							<!-- <a href=""><li>参数配置</li></a>
							<a href=""><li>实拍图</li></a> -->
							<!--<a href=""><li>购买记录</li></a>
							<a href=""><li>问题咨询</li></a>
							<a href=""><li>累计评价</li></a>-->
						</ul>
					</div>
					<?php echo $shopDetailedata['detailed']?>
				</div>
				<!--右侧结束-->
			</div>			
		</div>
		<!--公共底部-->
		<!--底部-->
		<div id="footer">
			<div id="footer1">
				<div class="footer_logo">
					<img src="./Public/Home/imgs/logo-footer.png"/>
				</div>							
			</div>			
		</div>
		<div id="banquan">
			<span>© 2004-2016 www.autohome.com.cn All Rights Reserved. 汽车之家 版权所有</span>
		</div>
	</body>
</html>
